//mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTcpSocket>
#include <QTimer>
#include <QDateTime>
#include "QLineEdit"
#include <QList>
#include "qcustomplot.h"
#include <thread>
#include <QFile>
#include <QTextEdit>
#include <QDir>
#include <QFileDialog>
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    void initChart();   //初始化绘图

    void initChart_openfile();

    void initfile();     //初始化文件

    bool loadFile(const QString& filename);

    bool confirmFile(const QString sFile) const;

private slots:

    void on_pushButton_Connect_clicked();

    void timeshow();

    void socket_Read_Data();

    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

private:
    Ui::MainWindow *ui;
    QTcpSocket *socket;
    QTimer *ti;
    QCustomPlot *custmoport;
    QCPGraph *graph1;
    QCPGraph *graph2;
    QCPGraph *graph3;
    QCPGraph *graph4;
    QCPGraph *graph_1;
    QVector<double>x;
    QVector<double>y;
    QVector<double>x_2;
    QVector<double>y_2;
    QVector<double>x_tm;
    QVector<double>y_tm;
    QVector<double>x_hi;
    QVector<double>y_hi;


    QVector<double>read_ph;
    QVector<double>read_ph2;
    QVector<double>read_tm;
    QVector<double>read_hi;
    int sizz , sizz2 , sizz3;
    QDateTime tim;
    QString phh , phh2 ,tmm , hii;
    QFile *fileph ,*fileph2 , *filetm , *filehumi;
     QTextStream *out , *out1 , *out2;
    //Chart chart;
};

#endif // MAINWINDOW_H
